package org.creativor.rayson.transport.client;

import static org.junit.Assert.assertNotNull;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import org.creativor.rayson.api.TransferArgument;
import org.creativor.rayson.api.TransferSocket;
import org.creativor.rayson.demo.proxy.DemoTransferArgument;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

/**
 * The class <code>TransportClientTest</code> contains tests for the class
 * <code>{@link TransportClient}</code>.
 * <p>
 * Copyright Creativor Studio (c) 2011
 * 
 * @generatedBy CodePro at 11-5-7 上午3:15
 * @author Nick Zhang
 * @version $Revision: 1.0 $
 */
public class TransportClientTest {
	/**
	 * Launch the test.
	 * 
	 * @param args
	 *            the command line arguments
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:15
	 */
	public static void main(String[] args) {
		new org.junit.runner.JUnitCore().run(TransportClientTest.class);
	}

	/**
	 * Perform pre-test initialization.
	 * 
	 * @throws Exception
	 *             if the initialization fails for some reason
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:15
	 */
	@Before
	public void setUp() throws Exception {
		// TODO: add additional set up code here
	}

	/**
	 * Perform post-test clean-up.
	 * 
	 * @throws Exception
	 *             if the clean-up fails for some reason
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:15
	 */
	@After
	public void tearDown() throws Exception {
		// TODO: add additional tear down code here
	}

	/**
	 * Run the TransferSocket
	 * createTransferSocket(SocketAddress,TransferArgument) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:15
	 */
	@Test(expected = java.net.ConnectException.class)
	public void testCreateTransferSocket_1() throws Exception {
		TransportClient fixture = TransportClient.getSingleton();
		SocketAddress serverAddress = new InetSocketAddress(1);
		TransferArgument argument = new DemoTransferArgument("");

		TransferSocket result = fixture.createTransferSocket(serverAddress,
				argument);

		// TODO: add additional test code here
		assertNotNull(result);
	}

	/**
	 * Run the TransferSocket
	 * createTransferSocket(SocketAddress,TransferArgument) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:15
	 */
	@Test(expected = java.net.ConnectException.class)
	public void testCreateTransferSocket_2() throws Exception {
		TransportClient fixture = TransportClient.getSingleton();
		SocketAddress serverAddress = new InetSocketAddress(1);
		TransferArgument argument = new DemoTransferArgument("");

		TransferSocket result = fixture.createTransferSocket(serverAddress,
				argument);

		// TODO: add additional test code here
		assertNotNull(result);
	}

	/**
	 * Run the TransferSocket
	 * createTransferSocket(SocketAddress,TransferArgument) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:15
	 */
	@Test(expected = java.net.ConnectException.class)
	public void testCreateTransferSocket_3() throws Exception {
		TransportClient fixture = TransportClient.getSingleton();
		SocketAddress serverAddress = new InetSocketAddress(1);
		TransferArgument argument = new DemoTransferArgument("");

		TransferSocket result = fixture.createTransferSocket(serverAddress,
				argument);

		// TODO: add additional test code here
		assertNotNull(result);
	}

	/**
	 * Run the TransferSocket
	 * createTransferSocket(SocketAddress,TransferArgument) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:15
	 */
	@Test(expected = java.net.ConnectException.class)
	public void testCreateTransferSocket_4() throws Exception {
		TransportClient fixture = TransportClient.getSingleton();
		SocketAddress serverAddress = new InetSocketAddress(1);
		TransferArgument argument = new DemoTransferArgument("");

		TransferSocket result = fixture.createTransferSocket(serverAddress,
				argument);

		// TODO: add additional test code here
		assertNotNull(result);
	}

	/**
	 * Run the TransferSocket
	 * createTransferSocket(SocketAddress,TransferArgument) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:15
	 */
	@Test(expected = java.net.ConnectException.class)
	public void testCreateTransferSocket_5() throws Exception {
		TransportClient fixture = TransportClient.getSingleton();
		SocketAddress serverAddress = new InetSocketAddress(1);
		TransferArgument argument = new DemoTransferArgument("");

		TransferSocket result = fixture.createTransferSocket(serverAddress,
				argument);

		// TODO: add additional test code here
		assertNotNull(result);
	}

	/**
	 * Run the TransferSocket
	 * createTransferSocket(SocketAddress,TransferArgument) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:15
	 */
	@Test(expected = java.net.ConnectException.class)
	public void testCreateTransferSocket_6() throws Exception {
		TransportClient fixture = TransportClient.getSingleton();
		SocketAddress serverAddress = new InetSocketAddress(1);
		TransferArgument argument = new DemoTransferArgument("");

		TransferSocket result = fixture.createTransferSocket(serverAddress,
				argument);

		// TODO: add additional test code here
		assertNotNull(result);
	}

	/**
	 * Run the RpcConnection getConnection(SocketAddress) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:15
	 */
	@Test(expected = java.net.ConnectException.class)
	public void testGetConnection_1() throws Exception {
		TransportClient fixture = TransportClient.getSingleton();
		SocketAddress serverAddress = new InetSocketAddress(1);

		RpcConnection result = fixture.createRpcConnection(serverAddress);

		// TODO: add additional test code here
		assertNotNull(result);
	}

	/**
	 * Run the RpcConnection getConnection(SocketAddress) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:15
	 */
	@Test(expected = java.net.ConnectException.class)
	public void testGetConnection_2() throws Exception {
		TransportClient fixture = TransportClient.getSingleton();
		SocketAddress serverAddress = new InetSocketAddress(1);

		RpcConnection result = fixture.createRpcConnection(serverAddress);

		// TODO: add additional test code here
		assertNotNull(result);
	}

	/**
	 * Run the RpcConnection getConnection(SocketAddress) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:15
	 */
	@Test(expected = java.net.ConnectException.class)
	public void testGetConnection_3() throws Exception {
		TransportClient fixture = TransportClient.getSingleton();
		SocketAddress serverAddress = new InetSocketAddress(1);

		RpcConnection result = fixture.createRpcConnection(serverAddress);

		// TODO: add additional test code here
		assertNotNull(result);
	}

	/**
	 * Run the RpcConnection getConnection(SocketAddress) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:15
	 */
	@Test(expected = java.net.ConnectException.class)
	public void testGetConnection_4() throws Exception {
		TransportClient fixture = TransportClient.getSingleton();
		SocketAddress serverAddress = new InetSocketAddress(1);

		RpcConnection result = fixture.createRpcConnection(serverAddress);

		// TODO: add additional test code here
		assertNotNull(result);
	}

	/**
	 * Run the RpcConnector getConnector() method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:15
	 */
	@Test
	public void testGetConnector_1() throws Exception {
		TransportClient fixture = TransportClient.getSingleton();

		RpcConnector result = fixture.getConnector();

		// TODO: add additional test code here
		assertNotNull(result);
	}

	/**
	 * Run the PacketManager getPacketManager() method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:15
	 */
	@Test
	public void testGetPacketManager_1() throws Exception {
		TransportClient fixture = TransportClient.getSingleton();

		PacketManager result = fixture.getPacketManager();

		// TODO: add additional test code here
		assertNotNull(result);
	}

	/**
	 * Run the TransportClient getSingleton() method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:15
	 */
	@Test
	public void testGetSingleton_1() throws Exception {

		TransportClient result = TransportClient.getSingleton();

		// TODO: add additional test code here
		assertNotNull(result);
	}

	/**
	 * Run the void notifyConnectionClosed(RpcConnection) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:15
	 */
	@Test
	public void testNotifyConnectionClosed_1() throws Exception {
		TransportClient fixture = TransportClient.getSingleton();
		RpcConnection connection = new RpcConnection(new InetSocketAddress(1),
				new PacketManager(), new Listener(new ConnectionManager()));

		fixture.notifyConnectionClosed(connection);

		// TODO: add additional test code here
	}

	/**
	 * Run the void ping(SocketAddress) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:15
	 */
	@Test(expected = org.creativor.rayson.exception.NetWorkException.class)
	public void testPing_1() throws Exception {
		TransportClient fixture = TransportClient.getSingleton();
		SocketAddress serverAddress = new InetSocketAddress(1);

		fixture.ping(serverAddress);

		// TODO: add additional test code here
	}

	/**
	 * Run the void ping(SocketAddress) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:15
	 */
	@Test(expected = org.creativor.rayson.exception.NetWorkException.class)
	public void testPing_10() throws Exception {
		TransportClient fixture = TransportClient.getSingleton();
		SocketAddress serverAddress = new InetSocketAddress(1);

		fixture.ping(serverAddress);

		// TODO: add additional test code here
	}

	/**
	 * Run the void ping(SocketAddress) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:15
	 */
	@Test(expected = org.creativor.rayson.exception.NetWorkException.class)
	public void testPing_11() throws Exception {
		TransportClient fixture = TransportClient.getSingleton();
		SocketAddress serverAddress = new InetSocketAddress(1);

		fixture.ping(serverAddress);

		// TODO: add additional test code here
	}

	/**
	 * Run the void ping(SocketAddress) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:15
	 */
	@Test(expected = org.creativor.rayson.exception.NetWorkException.class)
	public void testPing_12() throws Exception {
		TransportClient fixture = TransportClient.getSingleton();
		SocketAddress serverAddress = new InetSocketAddress(1);

		fixture.ping(serverAddress);

		// TODO: add additional test code here
	}

	/**
	 * Run the void ping(SocketAddress) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:15
	 */
	@Test(expected = org.creativor.rayson.exception.NetWorkException.class)
	public void testPing_2() throws Exception {
		TransportClient fixture = TransportClient.getSingleton();
		SocketAddress serverAddress = new InetSocketAddress(1);

		fixture.ping(serverAddress);

		// TODO: add additional test code here
	}

	/**
	 * Run the void ping(SocketAddress) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:15
	 */
	@Test(expected = org.creativor.rayson.exception.NetWorkException.class)
	public void testPing_3() throws Exception {
		TransportClient fixture = TransportClient.getSingleton();
		SocketAddress serverAddress = new InetSocketAddress(1);

		fixture.ping(serverAddress);

		// TODO: add additional test code here
	}

	/**
	 * Run the void ping(SocketAddress) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:15
	 */
	@Test(expected = org.creativor.rayson.exception.NetWorkException.class)
	public void testPing_4() throws Exception {
		TransportClient fixture = TransportClient.getSingleton();
		SocketAddress serverAddress = new InetSocketAddress(1);

		fixture.ping(serverAddress);

		// TODO: add additional test code here
	}

	/**
	 * Run the void ping(SocketAddress) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:15
	 */
	@Test(expected = org.creativor.rayson.exception.NetWorkException.class)
	public void testPing_5() throws Exception {
		TransportClient fixture = TransportClient.getSingleton();
		SocketAddress serverAddress = new InetSocketAddress(1);

		fixture.ping(serverAddress);

		// TODO: add additional test code here
	}

	/**
	 * Run the void ping(SocketAddress) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:15
	 */
	@Test(expected = org.creativor.rayson.exception.NetWorkException.class)
	public void testPing_6() throws Exception {
		TransportClient fixture = TransportClient.getSingleton();
		SocketAddress serverAddress = new InetSocketAddress(1);

		fixture.ping(serverAddress);

		// TODO: add additional test code here
	}

	/**
	 * Run the void ping(SocketAddress) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:15
	 */
	@Test(expected = org.creativor.rayson.exception.NetWorkException.class)
	public void testPing_7() throws Exception {
		TransportClient fixture = TransportClient.getSingleton();
		SocketAddress serverAddress = new InetSocketAddress(1);

		fixture.ping(serverAddress);

		// TODO: add additional test code here
	}

	/**
	 * Run the void ping(SocketAddress) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:15
	 */
	@Test(expected = org.creativor.rayson.exception.NetWorkException.class)
	public void testPing_8() throws Exception {
		TransportClient fixture = TransportClient.getSingleton();
		SocketAddress serverAddress = new InetSocketAddress(1);

		fixture.ping(serverAddress);

		// TODO: add additional test code here
	}

	/**
	 * Run the void ping(SocketAddress) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:15
	 */
	@Test(expected = org.creativor.rayson.exception.NetWorkException.class)
	public void testPing_9() throws Exception {
		TransportClient fixture = TransportClient.getSingleton();
		SocketAddress serverAddress = new InetSocketAddress(1);

		fixture.ping(serverAddress);

		// TODO: add additional test code here
	}

	/**
	 * Run the void start() method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:15
	 */
	@Test
	public void testStart_1() throws Exception {
		TransportClient fixture = TransportClient.getSingleton();

		fixture.start();

		// TODO: add additional test code here
	}

	/**
	 * Run the void start() method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:15
	 */
	@Test(expected = java.lang.IllegalThreadStateException.class)
	public void testStart_2() throws Exception {
		TransportClient fixture = TransportClient.getSingleton();

		fixture.start();

		// TODO: add additional test code here
	}
}